<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- 
    根据给定长度自动在字符串的前面补充想补充的字符串（只返回修改后的字符串，不修改原字符串）
      padStart(len, str)
        len 给定的长度，转换后
        str 想补充的字符串
  -->
</body>
<script>
  "use strict";
  let str = "好男人";
  let strPadStart = str.padStart(6, "好的");
  console.log(strPadStart);

  let strPadEnd = str.padEnd(6, "快来人呀");
  console.log(strPadEnd);
</script>

</html>